package com.ssy.jt808.gateway.domain.pojo;

import lombok.Data;

import java.util.Objects;

/**
 * 设备信息
 *
 * @author wangzezhou
 */
@Data
public class TerminalInfo{

  /** 驾驶员 ID */
  private Long driverId;

  /** 终端 id */
  private Long terminalId;

  /** 车辆ID */
  private Long vehicleId;

  /** 设备手机号 */
  private String phoneNo;

  /** 车牌号 */
  private String plateNo;

  /** 车辆组织 ID */
  private Long vehicleOrgId;

  /** 车辆组织关系 */
  private String orgAncestors;

  /** 协议版本号 */
  private Integer protocolVersion;

  public TerminalInfo(){
  }

  public TerminalInfo mobileNo( String mobileNo ){
    this.phoneNo = mobileNo;
    return this;
  }

  @Override
  public boolean equals( Object that ){
    if( this == that ){
      return true;
    }
    if( that == null ){
      return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
    TerminalInfo other = (TerminalInfo)that;
        return Objects.equals(this.terminalId, other.terminalId);
    }

    @Override
    public int hashCode() {
        return ((terminalId == null) ? 0 : terminalId.hashCode());
    }
}